<!DOCTYPE html>
<!-- saved from url=(0041)http://c.tsz90.com/home/feedback/add.html -->
<html xmlns="http://www.w3.org/1999/html"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    
    <title>新增反馈</title>
    <link rel="shortcut icon" href="http://c.tsz90.com/home/feedback/clientapp/images/new_images/favicon.ico">
<link href="__PUBLIC__/static/css/feedback/reset_5.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/static/css/feedback/style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__PUBLIC__/static/css/feedback/font-awesome.min.css">
<link href="__PUBLIC__/static/css/feedback/new_style.css" rel="stylesheet" type="text/css">
<!-- 弹出层 -->
<link rel="stylesheet" href="__PUBLIC__/static/css/feedback/dialog.css">
<script src="__PUBLIC__/static/js/feedback/jquery-2.0.3.min.js"></script>
<script src="__PUBLIC__/static/js/feedback/dialog.js"></script>
<!-- 弹出层 -->
<script type="text/javascript" src="__PUBLIC__/static/js/feedback/clipboard.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/feedback/global.js"></script>


    <link href="__PUBLIC__/static/css/feedback/bootstrap.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/static/css/feedback/feek_style.css" rel="stylesheet" type="text/css">
</head>
<body style="">
    <div class="site-header header-fixed">
        <a onclick="history.back()" class="back"></a>
        <div class="tit-name">新增反馈</div>
    </div>
    <section class="aui-scrollView">
        <div class="aui-view-box">
		<button type="button" class="btn btn-default" data-type="充值">充值</button>
		<button type="button" class="btn btn-default" data-type="提现">提现</button>
		<button type="button" class="btn btn-default" data-type="任务">任务</button>
		<button type="button" class="btn btn-default" data-type="采矿">采矿</button>
            <div class="aui-view-box-item">
                <h2>您的问题或建议:</h2>
                <textarea id="content" placeholder="请输入您需要反馈的内容"></textarea>
            </div>
            <div class="aui-view-box-item">
                <h2>您的联系方式:</h2>
                <input type="text" id="phone" placeholder="输入电话号码">
                <input type="text" id="email" placeholder="输入电子邮箱">
            </div>
            <div class="aui-view-box-item">
                <p>留下您的联系方式,以便我们了解问题后及时反馈和结果，紧急问题请联系客服。</p>
            </div>
            <div class="aui-btn-submit js-bind">
                <button id="btn">提交建议</button>
            </div>
        </div>
    </section>
    <script type="text/javascript">
        $(function () {
            $('.btn-default').click(function () {
                if($(this).hasClass("btn-primary")){
                	$(this).siblings().removeClass("btn-primary");
                	$(this).removeClass("btn-primary");
                }else{
                	$(this).addClass("btn-primary");
                	$(this).siblings().removeClass("btn-primary");
                }
            })
            //设置邮箱
            $('.js-bind').click(function () {
            	var c_type = $(".btn-primary").attr("data-type");;
				console.log(c_type);
				//return false;
                
                var content = $('#content').val();
                if ($.trim(content) == "") {
                    message("请输入您需要反馈的内容","","error");
                    return;
                }
                var phone = $('#phone').val();
                var email = $('#email').val();
                $.post(
                    "{:url('feedback/save')}",
                    {
                        phone:phone,
                        email:email,
                        c_type:c_type,
                        content:content
                    },
                    function (ret) {
                        console.log(ret);
                        // message(ret.code,ret.msg,ret.type);
                        if(ret.code=='success'){
                            message("反馈成功");
                            history.go(-1);
                        }else if(ret.code=='error'){
                            message("反馈失败");
                        }
                    },'json'
                );
            });
        });
        // $("#btn").click(function(){
        //     var c_type = $(".btn-primary").attr("data-type");;
        //     var phone = $('#phone').val();
        //     var email = $('#email').val();
        //     var content = $('#content').val();
        //     $.ajax({
        //         url:"{:url('feedback/save')}",
        //         type:"post",
        //         data:{
        //             phone:phone,
        //             email:email,
        //             c_type:c_type,
        //             content:content
        //         },
        //         success:function(ret){
        //             console.log(ret);
        //         }
        //     })
        // })
    </script>

 </body></html>